Conversation
Signed-off-by: Yuval Kohavi <yuval.kohavi@gmail.com>
88a94c7 to
bafc8ca
Compare
Signed-off-by: Yuval Kohavi <yuval.kohavi@gmail.com>
Signed-off-by: Yuval Kohavi <yuval.kohavi@gmail.com>
bafc8ca to
b1d63d4
Compare
There was a problem hiding this comment.
Pull Request Overview
This PR adds support for code execution and skill loading capabilities to KAgent. The changes enable agents to execute Python code in a sandboxed environment and load skills from OCI/Docker container images.
Key changes:
- Added sandboxed code execution using the
srt(sandbox runtime) command - Implemented skill fetching from container registries using
crane - Extended agent configuration to support code execution and skill loading via declarative specs
- Refactored skills plugin to support programmatic addition of skills to agents
Reviewed Changes
Copilot reviewed 39 out of 40 changed files in this pull request and generated 10 comments.
Show a summary per file
| File | Description |
|---|---|
| python/packages/kagent-adk/src/kagent/adk/sandbox_code_executer.py | New sandboxed code executor implementation using srt |
| python/packages/kagent-adk/src/kagent/adk/skill_fetcher.py | New skill fetching utility to pull skills from OCI images |
| python/packages/kagent-adk/src/kagent/adk/types.py | Added code_executor parameter to agent configuration |
| python/packages/kagent-adk/src/kagent/adk/skills/skills_plugin.py | Extracted skill tool addition logic into reusable function |
| python/packages/kagent-adk/src/kagent/adk/cli.py | Added --code flag and pull-skills command; moved logging configuration |
| go/internal/controller/translator/agent/adk_api_translator.go | Added logic to generate init containers for skill fetching and configure sandbox security context |
| go/api/v1alpha2/agent_types.go | Extended agent spec with Skills and ExecuteCode fields |
| python/Dockerfile | Added installation of sandbox runtime and crane tool |
Comments suppressed due to low confidence (3)
python/packages/kagent-adk/src/kagent/adk/skill_fetcher.py:34
- This assignment to 'registry' is unnecessary as it is redefined before this value is used.
This assignment to 'registry' is unnecessary as it is redefined before this value is used.
python/packages/kagent-adk/src/kagent/adk/skill_fetcher.py:35 - This assignment to 'repo' is unnecessary as it is redefined before this value is used.
This assignment to 'repo' is unnecessary as it is redefined before this value is used.
python/packages/kagent-adk/src/kagent/adk/cli.py:74 - Unnecessary 'pass' statement.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
python/packages/kagent-adk/src/kagent/adk/sandbox_code_executer.py
Outdated
Show resolved
Hide resolved
python/packages/kagent-adk/src/kagent/adk/skills/skills_plugin.py
Outdated
Show resolved
Hide resolved
| """ | ||
| # Split digest if present | ||
| name_part = image | ||
| ref = "latest" |
There was a problem hiding this comment.
go/api/v1alpha2/agent_types.go
Outdated
| // +optional | ||
| Deployment *DeclarativeDeploymentSpec `json:"deployment,omitempty"` | ||
|
|
||
| ExecuteCode *bool `json:"executeCode,omitempty"` |
There was a problem hiding this comment.
Can we be more specific about this field name, specifically this executor will execute code that is returned from the API directly, not files or anything like that. Also, maybe this should be an struct as we may want to support multiple executors in the future?
There was a problem hiding this comment.
changed to ExecuteCodeBlocks so it's more clear
Signed-off-by: Yuval Kohavi <yuval.kohavi@gmail.com>
Signed-off-by: Yuval Kohavi <yuval.kohavi@gmail.com>
Signed-off-by: Yuval Kohavi <yuval.kohavi@gmail.com>
Signed-off-by: Yuval Kohavi <yuval.kohavi@gmail.com>
Signed-off-by: Yuval Kohavi <yuval.kohavi@gmail.com>
Signed-off-by: Yuval Kohavi <yuval.kohavi@gmail.com>
659dd02 to
a5fba86
Compare
Signed-off-by: Yuval Kohavi <yuval.kohavi@gmail.com>
| Name: "KAGENT_SKILLS_FOLDER", | ||
| Value: "/skills", | ||
| } | ||
| needSandbox = true |
There was a problem hiding this comment.
by setting this to true here, are saying that if you add skills to the agent you'll always also need a sandbox? Are there agents with skills that won't need to execute code?
There was a problem hiding this comment.
there are skills that don't have code... but we don't know it ahead of time...
pull in skills to the agent from a docker registry. This is done in an init container:
follow up tasks